package com.demo.api.service.user;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.demo.client.model.user.SysUser;
import com.demo.api.vo.user.UserLogin;
import com.demo.api.vo.user.UserVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author Tan-Bowen
 * @version 1.0
 * @description TODO
 * @date 2021/8/5 10:16
 */
public interface IUserSystemService {
    /**
     * @author Tan-Bowen
     * @description TODO 获取所有用户列表
     * @date 2021/8/5 10:21
     * @param [page]
     * @paramType [com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.demo.api.model.user.SysUser>]
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.demo.api.model.user.SysUser>
     */
    IPage<UserVo.UserRes> userAll(Page<SysUser> page,UserVo.Select select);

    /**
     * @author Tan-Bowen
     * @description TODO 添加用户
     * @date 2021/8/5 11:50
     * @param [request]
     */
    void create(UserVo.Create request);

    /**
     * @author Tan-Bowen
     * @description TODO 编辑用户信息
     * @date 2021/8/25 11:09
     * @param [update]
     * @paramType [com.demo.api.vo.user.UserVo.Update]
     */
    void update(UserVo.Update update);

    /**
     * @author Tan-Bowen
     * @description TODO 根据用户名称查询
     * @date 2021/8/12 14:41
     * @param [userName]
     * @paramType [java.lang.String]
     * @return com.demo.api.model.user.SysUser
     */
    SysUser byUserName(String userName);

    /**
     * @author Tan-Bowen
     * @description TODO 平台用户登录（没有单点登录）
     * @date 2021/8/12 15:57
     * @param [login]
     * @paramType [com.demo.api.vo.user.UserLogin.Request]
     * @return com.demo.api.vo.user.UserLogin.Response
     */
    UserLogin.Response platformLogin(UserLogin.Request login,String ip);

    /**
     * @author Tan-Bowen
     * @description TODO 删除用户
     * @date 2021/9/20 10:59
     * @param [userId]
     * @paramType [java.lang.Long]
     * @return void
     */
    void deleteUser(Long userId);

    void updatePassword(String newPass, String oldPass);

    List<SysUser> getUsersList(List<Long> userIds);

    Map<Long,SysUser> getUsersMap(List<Long> userIds);
}
